<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/index.css">
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/shoppingcart/shoppincart.css">
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/shoppingcart/checkout.css"/>
		<script src="./Public/Home/js/shopping/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="./Public/Home/js/JS.js" type="text/javascript" charset="utf-8"></script>
		<script src="./Public/Home/js/shopping/shopping.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="./Public/Home/css/shoppingcart/place_order.css"/>

		<!--模态框-->
		<link rel="stylesheet" type="text/css" href="./Public/Home/js/shopping/bootstrap.min.css"/>
		<script src="./Public/Home/js/shopping/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>

		<script src="./Public/Home/js/shopping/area.js" type="text/javascript" charset="utf-8"></script>
		<!--城市联动-->
		<script type="text/javascript">$(function() {
	//初始化方法
	area.init('a');
	//修改的时候默认被选中效果
	// area.selected('黑龙江','哈尔滨','道里区');
})</script>
	</head>
	<body>

		{{include file="../Common/headers"}}
		<!--填写订单-->
		<div id="toporder">
			<a href="index.php">
				<img src="./Public/Home/images/shopping/5.jpg" alt="">
			</a>
			<div class="shopcar_nav">
				<h1 class="title">填写订单</h1>
			</div>
			<div class="fanhui">
				<a href="{{U('Cart/index')}}">
					返回修改购物车
				</a>
			</div>
		</div>

		<form action="{{U('Cart/place')}}" method="post">

			<!--填写地址-->
			<div id="address">
				<div class="address_color"></div>
				<span class="user_address">收货人信息</span>
				<a type="button" class="new_address" data-toggle="modal" data-target="#myModal">
					[使用新地址]
				</a>
				<div class="address_custorm">
					<ul class="address_ul">
						{{foreach from="$addrData" value="$v"}}
						<li class="common_li">
							<span class="send_address">寄送至</span>
							<input type="radio" name="aid" class="chose_address" value="{{$v['aid']}}" checked="checked" />
							<span class="code">邮编:{{$v['code']}}</span>
							<span class="address">详细地址:{{$v['area']}}({{$v['address']}})</span>
							<span class="consignee">收货人：{{$v['consignee']}}</span>
							<span class="mobile">手机：{{$v['mobile']}}</span>
							<span class="telephone">电话：{{$v['telephone']}}</span>
							<span class="del">×</span>
						</li>
						{{endforeach}}
					</ul>
				</div>
			</div>
			<!--收货地址结束

			<!--发票信息-->

			<div id="cover">
				<div id="paper_message">
					{{foreach from="$keyData" key="$k" value="$v"}}
					<input type="hidden" name="key[]" id="key" value="{{$k}}" />
					<div class="goods_message">
						以下商品由 <span>{{$v['options']['bname']}}</span> 选择合作快递配送
					</div>
					<div class="goods">
						<li>
							商品名称
						</li>
						<li>
							当当价
						</li>
						<li>
							促销价
						</li>
						<li>
							数量
						</li>
						<li>
							小计（元）
						</li>

					</div>

					<div class="goods">
						<li style="overflow: hidden;">
							{{$v['name']}}
						</li>

						<li>
							¥{{$v['options']['marketprice']}}
						</li>

						<li>
							¥{{$v['price']}}
						</li>
						<li>
							{{$v['num']}}
						</li>
						<li>
							¥{{$v['total']}}
						</li>

					</div>
					{{endforeach}}
					<div class="all_message" style="float: right;">
						<li>
							<span>商品总金额：</span>
							<span>¥</span>
							<span>{{$count['countMoney']}}</span>
						</li>
						<li>
							<span>运费：</span>
							<span>¥</span>
							<span>0.00</span>
						</li>
						<li>
							<span>使用优惠券：</span>
							<span>¥</span>
							<span>0.00</span>
						</li>
						<li>
							<span>使用花瓣：</span>
							<span>¥</span>
							<span>0.00</span>
						</li>
						<li>
							<span>商家活动：</span>
							<span>¥</span>
							<span>0.00</span>
						</li>
						<li>
							<b></b>
							<b> 应付金额：</b>
							<b>¥{{$count['countMoney']}}</b>
						</li>
					</div>

					<div class="all_message" style="float: left;background: none;overflow: hidden;width: 700px;">
						<ul style="height: 255px;">
							<li style="height: 150px;width: 700px;">
								<h2>商品清单</h2>
								{{foreach from="$keyData" value="$v"}}
								<div style="width: 100px;height: 100px; overflow: hidden;border-bottom:none;float: left;">
									<img style="width: 100px;float: left;" src="{{$v['options']['src']}}"/>
								</div>

								{{endforeach}}
							</li>
							<li style="height: 70px;">
								<h2>送货方式</h2>
								<p>
									普通快递送货上门，只工作日送货
								</p>
							</li>
							<li style="height: 70px;">
								<h2>备注:</h2>
								<p>
									<input type="text" class="form-control"name="remark" value="" />
								</p>
							</li>
					</div>
				</div>
				<style type="text/css">.all_message ul li {
	text-align: left;
	margin-left: 10px;
	margin-top: 10px;
}

.all_message ul li h2 {
	font-weight: bold;
	font-size: 14px;
}

.all_message ul li p {
	padding-left: 10px;
}</style>
			</div>

			</div>

			<!--发票信息结束-->

			<!--提交-->
			<ul id="send_you" style="float: left;">
				<li>
					应付总额:
				</li>
				<li>
					¥{{$count['countMoney']}}
				</li>
					<input type="submit" class="tjbtn" value="提交订单" />
			</ul>

		</form>
		<!--bootcss--模态框-->
		<form action="JavaScript:;" id="addr" method="post">
			<!-- Modal -->
			
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
				<div class="modal-dialog" role="document">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal" aria-label="Close">
							<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title" id="myModalLabel">新增收货地址</h4>
						</div>
						<div class="modal-body">
							<div>
								<span style="float: left;">所在地区</span>
								<br />
								<select name="area[]" style="width: 110px;float: left;margin-right: 10px;" class="form-control" id="a1">

								</select>
								<select name="area[]" style="width: 110px;float: left;margin-right: 10px;" class="form-control" id="a2">

								</select>
								<select name="area[]" style="width: 110px;" class="form-control" id="a3">

								</select>
							</div>
							<div>
								<span>邮编</span>
								<input type="text" class="form-control" name="code" id="" value="" />
							</div>
							<div>
								<span>详细地址</span>
								<input type="text" class="form-control" name="address" id="" value="" />
							</div>
							<div>
								<span>收货人姓名</span>
								<input type="text" class="form-control" name="consignee" id="" value="" />
							</div>
							<div>
								<span>手机号码</span>
								<input type="text" class="form-control" name="mobile" id="" value="" />
							</div>
							<div>
								<span>电话号码</span>
								<input class="form-control" type="text" name="telephone" id="" value="" />
							</div>

						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" data-dismiss="modal">
							取消
							</button>
							<button type="submit" class="btn btn-primary">
							确定
							</button>
						</div>
					</div>
				</div>
			</div>

		</form>
		<!--模态框end-->
<script type="text/javascript">
$(function() {
	$("#addr").submit(function() {
		addr = $(this).serialize();
			$.ajax({
				type: "post",
				url: "{{U('Cart/address')}}",
				data: addr,
				dataType:'json',
				success:function(phpData){
					var html = '<li class="common_li"><span class="send_address">寄送至</span>';
					html += '<input type="radio" name="aid" class="chose_address" value="'+phpData.aid+'" checked="checked" />';
					html += '<span class="code">邮编:'+phpData.code+'</span>';
					html += '<span class="address">详细地址:'+phpData.area+'('+phpData.address+')</span>';
					html += '<span class="consignee">收货人：'+phpData.consignee+'</span>';	
					html += '<span class="mobile">手机：'+phpData.mobile+'</span>';
					html += '<span class="telephone">电话：'+phpData.telephone+'</span>';
					html += '<span class="del">×</span></li>';
					$(".address_ul").append(html);
					$(".tjbtn").html();
				}
			});
		})
		//点击模态框按钮关闭
		$(".btn-primary").click(function(){
	    	$(".modal").modal('hide');
	   })
	})
</script>

		<!--提交结束-->
		{{include file="../Common/footers"}}
	</body>
</html>
